package pl.zmudzinski.adapter.example2;

import java.util.Enumeration;
import java.util.Iterator;

/**
 * @author lukasz.zmudzinski
 */
public class IteratorEnumeration implements Enumeration {
    private Iterator iterator;

    public IteratorEnumeration(Iterator iterator) {
        this.iterator = iterator;
    }

    public Iterator getIterator() {
        return iterator;
    }

    public void setIterator(Iterator iterator) {
        this.iterator = iterator;
    }

    public boolean hasMoreElements() {
        return iterator.hasNext();
    }

    public Object nextElement() {
       return iterator.next();
    }
}
